﻿<UserControl x:Class="cmdr.Editor.Views.MappingEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:views="clr-namespace:cmdr.Editor.Views"
             xmlns:ddButton="clr-namespace:cmdr.WpfControls.DropDownButton;assembly=cmdr.WpfControls"
             xmlns:styles="clr-namespace:cmdr.Editor.Styles"
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="300">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="boolToVisConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <ddButton:DropDownButton Margin="5" Content="Advanced Options" MenuPlacement="Bottom" ItemsSource="{Binding AdvancedOptions, Mode=OneWay}" Command="{Binding AdvancedOptionsCommand, Mode=OneTime}"/>
        
        <StackPanel Grid.Row="1">
            <Label>
                <Bold>Comment:</Bold>
            </Label>
            <views:CommentEditorView DataContext="{Binding CommentEditor, Mode=OneWay}" Margin="5,0,5,10" />
        </StackPanel>

        <StackPanel Grid.Row="2">
            <Label>
                <Bold>Conditions:</Bold>
            </Label>
            <views:ConditionsEditor DataContext="{Binding ConditionsEditor, Mode=OneWay}" Margin="5,-3,5,10" />
        </StackPanel>

        <StackPanel Grid.Row="3" Visibility="{Binding IsCommandEnabled, Mode=OneWay, Converter={StaticResource boolToVisConverter}}">
            <Label>
                <Bold>Settings:</Bold>
            </Label>
            <views:CommandEditor DataContext="{Binding CommandEditor, Mode=OneWay}" Margin="5,0,5,10" />
        </StackPanel>
        
        <StackPanel Grid.Row="4" Visibility="{Binding IsBindingEnabled, Mode=OneWay, Converter={StaticResource boolToVisConverter}}">
            <Label><Bold>Mapped To:</Bold></Label>
            <views:MidiEditor DataContext="{Binding MidiBindingEditor, Mode=OneWay}" Margin="5,0,5,10" />
        </StackPanel>
    </Grid>
</UserControl>
